import request from '@/utils/request';

//创建用户收件地址
export const addressCreate = (params: any) => {
    return request({
        url: '/app-api/member/address/create',
        method: 'POST',
        body: params,
        hideLoading: false,
    });
};
//更新用户收件地址
export const addresUpdate = (params: any) => {
    return request({
        url: '/app-api/member/address/update',
        method: 'PUT',
        body: params,
        hideLoading: false,
    });
};
//获得用户收件地址列表
export const addressList = (params: any) => {
    return request({
        url: '/app-api/member/address/list',
        method: 'GET',
        body: params,
        hideLoading: false,
    });
};
//获得用户收件地址
export const addressGet = (params: any) => {
    return request({
        url: '/app-api/member/address/get',
        method: 'GET',
        body: params,
        hideLoading: false,
    });
};
//获得默认的用户收件地址
export const addressGetDefault = (params: any) => {
    return request({
        url: '/app-api/member/address/get-default',
        method: 'GET',
        body: params,
        hideLoading: false,
    });
};
//删除用户收件地址
export const addressDelete = (params: any) => {
    return request({
        url: `/app-api/member/address/delete?id=${params.id}`,
        method: 'DELETE',
        hideLoading: false,
    });
};
